<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
 <%@ taglib uri="../../WEB-INF/translate.tld" prefix="ego" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
	<link rel="stylesheet" type="text/css" href="pub/dojo/dojo/resources/dojo.css" />
	<link rel="stylesheet" type="text/css" href="pub/dojo/dijit/themes/tundra/tundra.css" />
	<script type="text/javascript" src="pub/dojo/dojo/dojo.js" djConfig="parseOnLoad: true"></script> 
	<script type="text/javascript" src="pub/js/debug.js"></script>

	<script type="text/javascript" src="modules/account_move/script.js"></script>
	<script type="text/javascript">
	var lang_move_check_failed = "<ego:t>Move check failed. Please login to that google account, before moving the etApps data.</ego:t>";
	</script>
	
	<style type="text/css">
		.form {
			border:1px solid #cecece;
			margin: 10px;
			background-color: #edeeef;
		}
		.title {
			text-align: center;
			font-size: 14px;
			font-weight: bold;
			padding-bottom: 10px;
		}
		button {
			width: 80px;
			margin: 10px 5px 0 5px;
		}
	</style>
	<title>etApps - <ego:t>activate</ego:t></title>
</head>
<body class="tundra">
	<center id="img"><img src="pub/img/login-loading.gif" /></center>
	
	<div id="form" class="form" style="visibility:hidden">
		<div class="title"><ego:t>Activate your etApps leave manager</ego:t></div>
		
		<div style="text-align:center;padding:0 10px 4px;">
			<img src="modules/account_move/img/switch.png" /><br/>
			<ego:t>Every etApps leave manager customer needs a separate account for google calendars.</ego:t><br/>
			<ego:t>The etApps leave manager will store all calendars for your departments and employees in this google account.</ego:t><br/>
			<br/>
			<ego:t>At the moment you are using a google account provided by etApps. This account is only available for 30 days.</ego:t><br/>
			<ego:t>If you have created your own separate google account, you can simply transfer the existing calendars and settings to your account.</ego:t>
		</div>
		<% if (request.getAttribute("no_admin") != null) { %>
				<div style="color:red; font-size:16px;font-weight:bold;text-align:center">You are not authorized for this action.</div>
		<% } else { %>
		<table cellspacing="4" style="margin: auto auto">
			<tr>
				<td><ego:t>System Account</ego:t></td>
				<td id="sys1">
					<input type="text" dojoType="dijit.form.TextBox" id="form_systemAccount" value="" />
					<div class="dijitTooltipBelow dijitTooltipABRight" dojoType="dijit.Tooltip" connectId="form_systemAccount">
						<ego:t>Enter the Google-account for the system account</ego:t>
					</div>
				</td>
			</tr>
			<tr>
				<td><ego:t>System Password</ego:t></td>
				<td id="sys2">
					<input type="password" dojoType="dijit.form.TextBox" id="form_password" />
					<div dojoType="dijit.Tooltip" connectId="form_password"><ego:t>Enter the password of the Google-account</ego:t></div>
				</td>
			</tr>
			<tr><td colspan="2"><div id="error_check" style="color:#d00; display:none;"><ego:t>Check of credentials for google calendar service failed</ego:t>.</div></td></tr>
		</table>
		<% } %>
		<div style="float:left;">
			<button dojoType="dijit.form.Button" onclick="window.close();"><ego:t>Cancel</ego:t></button>
		</div>
		<div style="float:right;">
			<button dojoType="dijit.form.Button" onclick="submit_btn()"><ego:t>Submit</ego:t></button>
		</div>
		<div style="clear:both;"></div>
		<div jsId="dialog_error" dojoType="dijit.Dialog" title="<ego:t>Error</ego:t>" style="width:150px;text-align:center">
			<img src="pub/img/warning.gif" /><br/>
			<ego:t>Please check for correct input</ego:t>.
		</div>
		<div jsId="dialog_wait" dojoType="dijit.Dialog" title="<ego:t>Moving data</ego:t>" style="width:180px;text-align:center">
			<img src="pub/img/login-loading.gif" /><br/>
			<ego:t>Please wait</ego:t>...
		</div>
	</div>
	
	<div id="finished" class="form" style="display:none;text-align:center;">
		<div class="title"><ego:t>Data successfully moved</ego:t></div>
		<img src="modules/account_move/img/accepted.png" /><br/>
		<button dojoType="dijit.form.Button" onclick="window.close();"><ego:t>Close</ego:t></button>
	</div>
</body>
</html>
